<%@page import="sdfi.lee.DAO.YiqiDAO"%>
<%@page import="sdfi.lee.Entity.Yiqishare"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<c:url value='/css/admin.css' />" rel="stylesheet" >
<link rel="stylesheet" href="<c:url value='/css/common.css'></c:url>">
<link rel="stylesheet" href="<c:url value='/css/adnews.css'></c:url>" />
<script type="text/javascript" src="<c:url value='/js/jquery-1.6.js' />">
</script>
<script type="text/javascript">
	$(document).ready(function(){

		$("td a").click(function(){
			var athis=$(this);
			$.ajax({
				url:'../DeleteYiqiShare',
				data:{id:athis.attr("value")},
				dataType:"text",
				success:function(data,status){	
					if(data=="success")
						{
							athis.parents("tr:first").next("tr").remove();
							athis.parents("tr:first").remove();
						}
				},
				error:function(xhr,status){
					alert(status);
				}
			});
			return false;
		});
	});
</script>
</head>
<body>
	<%
		String pg=request.getParameter("pg");
		Integer intpg=null;	
	if(pg==null) intpg=new Integer(1);
	else intpg=Integer.valueOf(pg);
	List<Yiqishare> yiqishares=new YiqiDAO().getAllYiqiAll(intpg,20);
	request.setAttribute("yiqishares",yiqishares);
	%>
</body>
<div>
<table border="1" cellspacing="0" width="700px" style="text-align:left">

<tr>
					<th>
						仪器
					</th>
					<th>
						类型
					</th>
					<th>
						所属单位
					</th>
					<th>
						生产厂家
					</th>
					<th>
						联系人
					</th>
					<th>
						联系方式
					</th>
					<th>
						删除
					</th>
				</tr>
	<c:forEach items="${requestScope.yiqishares}" var="shares">
		
			
				<tr>
					<td>
						${shares.yiqiname}
					</td>
					<td >
						<a title="${share.yiqitype }">${fn:substring(shares.yiqitype,0,3) }</a>
					</td>
					<td>
						${shares.unit}
					</td>
					<td>
						${shares.factory}
					</td>
					<td>
						${shares.relation}
					</td>
					<td>
						${shares.phone}
					</td>
					<td>
						<a href="" style="font-size:12;color:#000000;cursor:pointer;text-decoration:none" value="${shares.id}">删除</a>
					</td>
				</tr>
				<Tr>
				
					<td  colspan="7">
						${shares.userfor}
					</td>
				</Tr>
				
				
			
	
	</c:forEach>
	</table>
		</div>
		
		
		<div id="pages" style="text-align:center">
		<c:url var="up" value="/admin/yiqisharemg.jsp">
			<c:param name="pg" value="${param.pg-1}"></c:param>
		</c:url>
		<c:url var="down" value="/admin/yiqisharemg.jsp">
			<c:param name="pg" value="${param.pg+1}"></c:param>
		</c:url>
			<font>
				<c:if test="${param.pg==1}">&lt;</c:if>
				<c:if test="${param.pg!=1}"><a href="${up}">&lt;</a></c:if>
			</font>
			<font>
				${param.pg}
			</font>
			<font>
				<c:choose>
					<c:when test="${fn:length(requestScope.list)<20}">&gt;</c:when>
					<c:otherwise><a href="${down}">&gt;</a></c:otherwise>
				</c:choose>
			</font>
		
	</div>
</html>